#include <iostream>
using namespace std;

//计算整数a中每个数字的出现次数，放入counter数组中
void counts(int a,int counter[])
{
    while(true)
    {
        int temp = a%10;
        counter[temp] = counter[temp] + 1;
        a = a/10;
        if(a == 0)
            break;
    }
    return;
}
int main()
{
    int N;
    int a[1000];
    cin >> N;
    for(int i = 0; i<N; i++)
        cin >> a[i];
    int counter[10] ={};
    for(int i = 0; i<N; i++)
        counts(a[i],counter);
    
    int max =counter[0];
    for(int i = 0; i<10; i++)
    {
        if(max < counter[i])
            max = counter[i];
    }
    cout<<max<<":";
    for(int i = 0; i<10; i++)
    {
        if(max == counter[i])
            cout<<" "<<i;
    }
    

}